<template>
  <div id="app">
    <div v-if="stae" class="box">
      <!-- left-侧边栏 -->
      <div class="box-left">
        <Header />
      </div>
      <!-- right -->
      <div class="box-right">
        <!-- 导航 -->
        <div class="box-header">
          <daoHang />
        </div>
        <!-- 主体 -->
        <div class="box-mian">
          <router-view />
        </div>
      </div>
    </div>
    <template v-else>
      <router-view />
    </template>
  </div>
</template>

<script>
import Header from './components/header.vue';
import daoHang from './components/daohang.vue';
export default {
  name: 'App',
  components: {
    Header,
    daoHang
  },
  data() {
    return {
      stae: false,    // 登录状态
    }
  },
  created() {
    if (this.$route.name == 'Login') {
      this.stae = false;
    } else {
      this.stae = true;
    }
  }
}
</script>

<style>
* {
  margin: 0;
  padding: 0;
}

html,
body {
  overflow: hidden;
  min-width: 1920px;
  height: 100vh;
  width: 100%;
  height: 100%;
}

#app {
  width: 100%;
  height: 100%;
}

.box {
  width: 100%;
  height: 100%;
  display: flex;
  background: rgba(235, 236, 237, 1);
}

.box-left {
  width: 275px;
}

.box-right {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  padding: 0 0 0 25px;
  box-sizing: border-box;
}

.box-mian {
  width: 100%;
  display: flex;
  padding-right: 25px;
  box-sizing: border-box;
}

.box-right::-webkit-scrollbar {
  width: 4px;
}

.box-right::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #517BFF;
}

.box-right::-webkit-scrollbar-track {
  border-radius: 0;
  background: rgba(0, 0, 0, 0.1);
}

.box-header {
  position: sticky;
  z-index: 99;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(235, 236, 237, 1);
  padding: 25px 0;

}
</style>
